<?php

namespace App\Http\Controllers;


use App\Services\ElasticSearchService;
use App\Services\RedisGeo;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
    public function test()
    {
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go2(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go3(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go4(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go5(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go6(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }
    public function go7(){
        for ($i=0;$i<=1000;$i++){
            $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
        }
    }public function go8(){
    for ($i=0;$i<=1000;$i++){
        $this->geturl('http://book.lishuo.net/read/lhrsb/blank');
    }
}
    function geturl($url){
        $headerArray =array("Content-type:application/json;","Accept:application/json");
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch,CURLOPT_HTTPHEADER,$headerArray);
        $output = curl_exec($ch);
        curl_close($ch);
        $output = json_decode($output,true);
        return $output;
    }
}
